package org.jdemo.tools.bookmark;

import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.SimpleBookmark;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;

/**
 * BookmarkExporter
 *
 * @author longlin(longlin@cyou-inc.com)
 * @date 2014-3-10
 * @since V1.0
 */
public class BookmarkExporter {
    public static void main(String[] args) throws IOException {
//        exportBookmark("F:\\iPad\\pdf\\__\\add\\高性能mysql 第3版.pdf");
        exportBookmark("F:\\iPad\\pdf\\Java\\Java网络编程精解.pdf");
    }

    public static void exportBookmark(String srcPdf) throws IOException {
        PdfReader reader = new PdfReader(srcPdf);
        List<HashMap<String, Object>> outlines = SimpleBookmark.getBookmark(reader);
        System.out.println(outlines);
    }
}
